# class Cat:
#     __name='小懒猫'
#     def print(self):
#         print('私有方法')
#         print(self.__name)
# cat=Cat()
# cat.print()
# print(cat.__name)
#重写
# class Book(object):
#     def bookname(self):
#         print("小王子")
# class Book2(Book):
#     def bookname(self):
#         print("基于小王子改编")
# book=Book2()
# book.bookname()
#多态
class Cat:
    def shout(self):
        print("喵喵~~")
class Dog:
    def shout(self):
        print("汪汪~~")
def shout(obj):
    obj.shout()
cat=Cat()
dog=Dog()
shout(cat)
shout(dog)